<?php
/**
 * Questions Category page view
 *
 * Страница категорий вопросов теста
 *
 * @package zfhrtool
 * @subpackage View
 */
$this->headTitle($this->translate('[LS_PAGE_TITLE_QUESTION_CATEGORIES]'));
?>

<div id="main">
    <div class="menu-h f-right">
	    <ul>
	        <li><a href="<?=$this->url(array('controller' => 'index', 'action' => 'index'), null, true)?>">Главная</a></li>
	        <li><a href="<?=$this->url(array('controller' => 'test', 'action' => 'edit', 'testId' => $this->testId), null, true)?>">Вопросы теста</a></li>
	        <li><a href="<?=$this->url(array('controller' => 'questioncategory', 'action' => 'edit', 'testId' => $this->testId), null, true)?>">Добавить категорию</a></li>
	    </ul>
    </div>
	<h1 class="title" style="display:inline; border:0">
	    <?php echo $this->translate('[LS_PAGE_TITLE_QUESTION_CATEGORIES]')?> : 
	</h1>
	<!-- Таблица категорий -->
	<table width="100%" border="1" cellpadding="0" cellspacing="0" class="tablesorter">
	<thead>
		<tr class="head">
			<th>Категория</th>
			<th>Комментарии</th>
			<th class="action">Действия</th>
		</tr>
	</thead>
	<tbody>
	    <?php if (!empty($this -> arrCategory)): ?>
    <?php foreach ($this -> arrCategory as $category): ?>
		<tr class="item_row">
			<td><?php echo $this->escape( $category['name'] ); ?></td>
			<td><?php echo $this->escape( $category['descr'] ); ?></td>
			<td class="action">
                <a href="<?php echo $this -> url ( array ( 'controller' => 'questioncategory', 'action' => 'edit', 'categoryId' => $category['id']) ); ?>">
                    <img src="<?php echo $this->baseUrl() . '/images/edit.png'?>" title="Изменить" class="img_doing" />
                </a>
                <a href="<?php echo $this -> url ( array ( 'controller' => 'questioncategory', 'action' => 'remove', 'categoryId' => $category['id']) ); ?>" onClick="return confirm('<?php echo $this->translate('[LS_LINK_REMOVE_CONFIRMATION]'); ?> \' <?php echo $this->escape( $category['name'] ); ?>\'');">
                    <img src="<?php echo $this->baseUrl() . '/images/delete2.png'?>" title="Удалить" class="img_doing" />
                </a>
			</td>
		</tr>
    <?php endforeach; ?>
<?php else: ?>
		<tr class="item_row">
			<td colspan="3">нет категорий</td>
		</tr>
<?php endif;?>
	</tbody>
	</table>
	<!-- End of Таблица тестов-->
</div>